
/**
copyright:Developer's work team
version:1.0
author:duck
time:2009-07-03
*/
/**
xmlHttp,ajax object
*/
var xmlHttp;
Ajax = function () {
};

function validate(obj){
return true;
}
Ajax.request = function (obj) {
	if (!validate(obj) ) {
		return;
	} else {
		createXmlHttpRequest();
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200) {
					obj.success(xmlHttp);
				}
				if (xmlHttp.status == 202) {
					alert("server:++++++++++" + xmlHttp.responseText);
				}
				if (xmlHttp.status == 400) {
					alert("server:++++++++++" + xmlHttp.responseText);
				}
				if (xmlHttp.status == 404) {
					obj.noSuchResource(xmlHttp);
				}
				if (xmlHttp.status == 500) {
					obj.failure(xmlHttp);
				}
			}
		};
		xmlHttp.open(obj.method, obj.url);
	
			xmlHttp.send(null);
		
	}
};
function createXmlHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		if (windox.XMLHttpRequest) {
			xmlHttp = new XMLHttpRequest();
		}
	}
}

function $(id){
	return document.getElementById(id);
}

Jsondecoder=function(){}
Jsondecoder.decode=function(jsonString){
		return eval('('+jsonString+')');
}
function encode(str){
		return encodeURI(encodeURI(str));
	}